@extends('admin.layout')
@section('content')

<!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                电影管理
                <small>发表影评</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>后台主页</a></li>
                <li><a href="#">电影</a></li>
                <li class="active">发表影评</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title"> 快速发表影评</h3>
                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/cate/postPublish') }}" method="post" enctype="multipart/form-data">
                            {{ csrf_field() }}
                            <div class="box-body">
                            @if(count($errors) > 0)
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    <h4><i class="icon fa fa-ban"></i>警告</h4>
                                    @foreach($errors->all() as $error)
                                            <li>{{$error}}</li>
                                    @endforeach
                                </div>
                            @endif
                                <div class="form-group">
                                    <input type="hidden" name="pid" value="{{ $data -> id }}">
                                    <input type="hidden" name="uid" value="{{ session('users') -> id }}">
                                    <input type="hidden" name="auth" value="0">
                                    <label for="exampleInputname">电影名称</label>
                                    <input type="text" name="pname" value="{{ $data -> name }}" class="form-control" id="exampleInputUsername"
                                           disabled>
                                </div>
                                <div>
                                    <h4 class="box-title">正文
                                        <small>影评内容</small>
                                    </h4>
                                    <div class="box-body pad">
                                            <!-- <textarea style="width: 100%; height: 151px; resize: none;" id="editor1" name="cast" rows="10" cols="80" placeholder=""></textarea> -->
                                            <!-- 加载编辑器的容器 -->
                                            <script id="container" name="content" type="text/plain">请在这里输入正文内容</script>
                                            <!-- 配置文件 -->
                                            <script type="text/javascript" src="{{ url('/admin/UE/ueditor.config.js') }}"></script>
                                            <!-- 编辑器源码文件 -->
                                            <script type="text/javascript" src="{{ url('/admin/UE/ueditor.all.js') }} "></script>
                                            <!-- 实例化编辑器 <--></-->
                                            <script type="text/javascript">
                                                var ue = UE.getEditor('container');
                                            </script>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputname">评分：</label>
                                    <input type="radio" name="total" value="1" style="margin:5px;">1
                                    <input type="radio" name="total" value="2" style="margin:5px;">2
                                    <input type="radio" name="total" value="3" style="margin:5px;">3
                                    <input type="radio" name="total" value="4" style="margin:5px;">4
                                    <input type="radio" name="total" value="6" style="margin:5px;">6
                                    <input type="radio" name="total" value="7" style="margin:5px;">7
                                    <input type="radio" name="total" value="8" style="margin:5px;">8
                                    <input type="radio" name="total" value="9" style="margin:5px;">9
                                    <input type="radio" name="total" value="10" style="margin:5px;">10
                                </div>
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">添加</button>
                            </div>
                        </form>
                    </div><!-- /.box -->
                </div><!--/.col (left) -->     
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
<script type="text/javascript">
    $('input[name="time"]').on('blur', function(){
        //获取输入的值
        var v = this.value;
        // console.log(v);
        //声明正则
        var reg = /^\d{4}$/;
        //验证
        var res = reg.test(v);
        //判断
        if(res)
        {
            this.style.border = '1px solid #0f0';
        }else {
            this.style.border = '2px solid #f00';
        }
    })
</script>
    

@endsection